<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Insert title here</title>
<style>
.error {
	color: #ff0000;
	font-style: normal;
	font-weight: bold;
}

#lewa {
	margin: 0px;
	border: none;
	padding: 0px;
	width: 540px;
	float: left;
}

#prawa {
	margin: 0px;
	border: none;
	padding: 0px;
	width: 540px;
	float: right;
}

#center {
	margin: 30px;
	border: none;
	padding-top: 250px;
	width: 660px;
	float: center;
}

#kryt {
	margin: 0px;
	border: none;
	padding: 30px;
	width: 200px;
	float: left;
}

#sort {
	margin: 0px;
	border: none;
	padding:30px;
	width: 200px;
	float: left;
}

#sortright {
	margin: 0px;
	border: none;
	padding: 30px;
	width: 400px;
	float: left;


}

ol {
  list-style-type:none;
  padding:0;
  margin:0;
  font-size:18px;
  height:2em;
  line-height:2em;
  text-align:center;
}


ol > li {
  float:left;
  background-color:#FDD700;
  width:150px;
}
</style>
</head>
<body bgcolor="#F5F4DA">
	<c:url value="/j_spring_security_logout" var="logoutUrl" />

	<!-- csrt for log out-->
	<form action="${logoutUrl}" method="post" id="logoutForm">
		<input type="hidden" name="${_csrf.parameterName}"
			value="${_csrf.token}" />
	</form>

	<script>
		function formSubmit() {
			document.getElementById("logoutForm").submit();
		}
	</script>

	<c:if test="${pageContext.request.userPrincipal.name != null}">
		<h2>Jestes zalogowany jako: ${pageContext.request.userPrincipal.name}</h2>
	</c:if>
	

 <ol>
    <li><a href="register">dodaj studenta</a></li>
    <li><a href="users">tabela</a></li>
    <li><a href="pdf">PDF</a></li>
    <li><a href="/jee/">Strona glowna</a></li>
    <li><a href="javascript:formSubmit()"> Wyloguj sie</a></a></li>
  </ol>

	<h2>Tabela</h2>
    <c:if test="${!empty employeeList}">
		<table class="data" border=1>
			<tr>
				<th>Dane</th>
				<th>Email</th>
				<th>Login</th>
				<th>Haslo</th>
				<th>Telefon</th>
				<th>PESEL</th>
				<th>Plec</th>
				<th>Data ur.</th>
				<th>Miejsce ur.</th>
				<th>Liceum</th>
				<th>Kierunek</th>
				<th>Suma pkt</th>
				<th>Status</th>
				<th>Akcja</th>
			</tr>
			<c:forEach items="${employeeList}" var="emp">
				<tr>
					<td>${emp.firstname}, ${emp.lastname}</td>
					<td>${emp.email}</td>
					<td>${emp.username}</td>
					<td>${emp.password}</td>
					<td>${emp.telephone}</td>
					<td>${emp.pesel}</td>
					<td>${emp.sex}</td>
					<td>${emp.birthday}</td>
					<td>${emp.birthplace}</td>
					<td>${emp.school}</td>
					<td>${emp.direction}</td>
					<td>${emp.sum}</td>
					<td>${emp.status}</td>
					<td><a href="delete/${emp.id}">usun </a> <a
						href="edit/${emp.id}"> pobierz</a> <a href="accept/${emp.id}">
							przyjmij</a>
					</td>
				</tr>
			</c:forEach>
		</table>
	</c:if>
</body>
</html>